Parsimonious handling of word inflection via categorical stem + suffix n-gram language models

ABSTRACT

Systems and processes are disclosed for predicting words using a categorical stem and suffix word n-gram language model. A word prediction includes determining a stem probability using a stem language model. The word prediction also includes determining a suffix probability using suffix language model decoupled from the stem model, in view of one or more stem categories. The word prediction also includes determine a probability of the stem belonging to the stem category. A joint probability is determined based on the foregoing, and one or more word predictions having sufficient likelihood. In this way, the categorical stem and suffix language model constraints predicted suffixes to those that would be grammatically valid with predicted stems, thereby producing word predictions with grammatically valid stem and suffix combinations.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority from U.S. Provisional Ser. No.62/058,060, filed on Sep. 30, 2014, entitled “Parsimonious Handling ofWord Inflection via Categorical Stem+Suffix N-Gram Language Models,”which is hereby incorporated by reference in its entirety for allpurposes.

This application also relates to the following applications: U.S. PatentApplication Ser. No. 62/005,837, entitled “Device, Method, and GraphicalUser Interface for a Predictive Keyboard,” filed May 30, 2014, (AttorneyDocket No. P23128USP1/18602-26551US); U.S. patent application Ser. No.14/713,420, “Entropy-Guided Text Prediction Using Combined Word andCharacter N-gram Language Models,” filed May 15, 2015, (Attorney DocketNo. P22164US1/106842105800); U.S. patent application Ser. No.14/724,641, “Text Prediction Using Combined Word N-gram and UnigramLanguage Models,” filed May 28, 2015, (Attorney Docket No.P23887US1/106842122800); and U.S. patent application Ser. No.14/719,163, “Canned Answers in Messages,” filed May 21, 2015, (AttorneyDocket No. P22980US1/106842121600); which are hereby incorporated byreference in their entirety for all purposes.

FIELD

This application relates generally to word predictions and, morespecifically, to reducing the likelihood of word predictions involvinggrammatically incorrect word inflections.

BACKGROUND

Electronic devices and the ways in which users interact with them areevolving rapidly. Changes in size, shape, input mechanisms, feedbackmechanisms, functionality, and the like have introduced new challengesand opportunities relating to how a user enters information, such astext. Statistical language modeling can play a central role in inputprediction and/or recognition, such as keyboard input prediction andspeech (or handwriting) recognition. Effective language modeling canthus play a critical role in the overall quality of an electronic deviceas perceived by the user.

In some examples, statistical language modeling is used to convey theprobability of occurrence in the language of possible strings of nwords. Given a vocabulary of interest for an expected domain of use,determining the probability of occurrence of possible strings of n wordscan be done using a word n-gram model, trained to provide theprobability of the current word given the n−1 previous words. Trainingdata can be obtained from machine-readable text databases havingrepresentative documents in the expected domain.

Due to the finite size of such databases, however, many occurrences ofn-word strings can be seen infrequently, yielding unreliable predictionresults for all but the smallest values of n. Relatedly, sometimes it iscumbersome or impractical to gather a sufficiently large amount oftraining data. Further, the sizes of resulting language models mayexceed what can reasonably be deployed onto portable electronic devices.Though it is possible to prune training data sets and/or n-gram languagemodels to an acceptable size, pruned models tend to have reducedpredictive power. Grammatically incorrect predictions are particularlyproblematic, as bad predictions are often more distracting than the lackof a prediction.

SUMMARY

A compact and robust language model that can provide accurate inputprediction and/or input recognition is desirable. Systems and processesare disclosed for predicting words using decoupled stem and suffixlanguage models, and further constraining the predicted word stem andsuffix using a categorical stem and suffix language model, therebylimiting word predictions to grammatically valid stem and suffixcombinations.

In some embodiments, input is received from a user. Using an n-gram wordlanguage model (e.g., an n-gram stem language model in combination withan n-gram suffix language model), the probability of a predicted word isdetermined based on a previously-input word in the received input. Thepredicted word contains a predicted stem and a predicted suffix. Using acategorical stem and suffix language model, the probability that thepredicted suffix is grammatically valid when conjoined with thepredicted stem is determined. An integrated probability of the predictedword is determined based on the probabilities produced by the stemlanguage model, suffix language model, and the categorical stem andsuffix language model. One or more candidate words—for example, the mostprobable word, out of multiple predicted words, based on integratedprobabilities—is determined. The candidate word(s) may be displayedand/or played-back. A graphical user interface can allow the user toselect a candidate word without having to manually input the entireword. In this way, the efficiency of the man-machine interaction and theuser's overall user experience are improved.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an exemplary system for constraining word predictionsbased on a categorical stem and suffix language model.

FIG. 2 illustrates an exemplary process for constraining wordpredictions based on a categorical stem and suffix language model.

FIG. 3 illustrates a functional block diagram of an electronic deviceconfigured to constraining word predictions based on a categorical stemand suffix language model.

DETAILED DESCRIPTION

In the following description, reference is made to the accompanyingdrawings in which it is shown by way of illustration specific examplesthat can be practiced. It is to be understood that other examples can beused and structural changes can be made without departing from the scopeof the various examples.

It is useful for an electronic device to provide predictive text inputbased on input already entered by a user. For example, as a user enterstext into a draft e-mail message, the electronic device may suggestpossible next words for user selection to reduce the amount of manualtyping that is needed. Based on the user's previous input, theelectronic device can calculate possible next words using word n-gramlanguage models, and determine probabilities of different possible nextwords. One or more of the possible next words—such as a subset havingthe highest predictions probabilities—can be displayed on-screen foruser selection. In this way, the electronic device can be permit userentry of one or more words without requiring the user to manually entereach character of each word. In order to be truly helpful, however, wordpredictions need to be grammatically valid.

The occurrence of word inflection raises certain challenges in thecontext of word predictions using word n-gram language models. Wordinflection refers to the modifying of words to encode grammaticalinformation such as tense, number, gender, so forth. For example,English inflects regular verbs for past tense using the suffix “_ed” (asin “talk”→“talked”). Other languages can exhibit higher levels of wordinflection: Romance languages such as French have more overt inflectiondue to complex verb conjugation and gender declension. Agglutinativelanguages such as Finnish have even higher levels of inflection, as aseparate inflected form may be needed for each grammatical category.

In n-gram language modeling, word inflection generally increases thesize of the underlying vocabulary needed for word prediction, as eachinflected form of a word (e.g., “talks”, “talked”, “talking”) can bethought of as its own word by the language model. This increase invocabulary leads to attendant problems such as difficulties in obtainingsufficient training data and resulting language models that are largerthan ideal for deployment onto portable electronic devices. For thesereasons, a brute force approach to handling word inflections, whilepossible, is not desirable.

Attention is now directed to the possibility of breaking words into stemand suffix forms, and using decoupled language models to train stem dataand suffix data for purposes of n-gram language modeling. In general, aninflected word can be broken into a stem and a suffix, and one languagemodel (a “stem LM”) can be trained on the stem and suffix dataexpurgated from all suffixes, while another language model (a “suffixLM”) can be trained based on the stem and suffix data expurgated fromall stems.

Consider the sentence “he talked fast”: a stem LM can be trained basedon (among others) the trigram of (“he”, “talk_” and “fast”), and asuffix LM can be trained based on (among others) the trigram of (“he”,“_ed”, and “fast”). Under this approach, it is possible to predict asentence like “he arrived fast” even if the stem and suffix languagemodels have not been previously trained on this particular 3-wordstring, so long as a related string was observed, such as “he arrivesfast”. This ability to, in effect, substitute one stem for another (or,equivalently, one suffix for another) produces robust predictions whilerequiring feasible amounts of training data, and translate into languagemodels suitable for deployment, particularly in terms of size.

However, under this approach involving decoupled stem and suffixlanguage models, it is still possible to predict a sentence like “hespeaked fast”, given a prior observation such as “he speaks fast”. Thisprediction is undesirable as the word “speaked” is grammaticallyincorrect; a more grammatically proper prediction would have been “hespoke fast”. To address this issue of spurious predictions of inflectedwords, a categorical stem and suffix n-gram language model can bedevised to enforce necessary stem to suffix constraints during wordprediction.

FIG. 1 illustrates exemplary system 100 for predicting words using acategorical stem and suffix n-gram language model component. Exemplarysystem 100 includes user device 102 (or multiple user devices 102) thatcan provide a user input interface or environment. User device 102 caninclude any of a variety of devices, such as a cellular telephone (e.g.,smartphone), tablet computer, laptop computer, desktop computer,portable media player, wearable digital device (e.g., digital glasses,wristband, wristwatch, brooch, armbands, etc.), television, set top box(e.g., cable box, video player, video streaming device, etc.), gamingsystem, or the like. User device 102 can have display 116. Display 116can be any of a variety of displays, and can also include a touchscreen,buttons, or other interactive elements. In some examples, display 116 isincorporated within user device 102 (e.g., as in a touchscreen,integrated display, etc.). In some examples, display 116 is externalto—but communicatively coupled to—user device 102 (e.g., as in atelevision, external monitor, projector, etc.).

User device 102 can include or be communicatively coupled to keyboard118, which can capture user-entered text (e.g., characters, words,symbols, etc.). Keyboard 118 can include any of a variety of text entrymechanisms and devices, such as a stand-alone external keyboard, avirtual keyboard, a remote control keyboard, a handwriting recognitionsystem, or the like. For example, keyboard 118 can be a virtual keyboardon a touchscreen capable of receiving text entry from a user (e.g.,detecting character selections from touch). In another example, keyboard118 can be a virtual keyboard shown on a display (e.g., display 116),and a pointer or other indicator is used to indicate character selection(e.g., indicating character selection using a mouse, remote control,pointer, button, gesture, eye tracker, etc.). In yet another example,keyboard 118 can include a touch sensitive device capable of recognizinghandwritten characters. In still other examples, keyboard 118 caninclude other mechanisms and devices capable of receiving text entryfrom a user.

User device 102 can also include processor 104, which can receive textentry from a user (e.g., from keyboard 118) and interact with otherelements of user device 102 as shown. In one example, processor 104 canbe configured to perform any of the methods discussed herein, such aspredicting words using a categorical stem and suffix n-gram languagemodel. In other examples, processor 104 can cause data (e.g., enteredtext, user data, etc.) to be transmitted to server system 122 throughnetwork 120. Network 120 can include any of a variety of networks, suchas a cellular telephone network, WiFi network, wide area network, localarea network, the Internet, or the like. Server system 120 can include aserver, storage devices, databases, and the like and can be used inconjunction with processor 104 to perform any of the methods discussedherein. For example, processor 104 can cause an interface to be providedto a user for text entry, can receive entered text, can transmit some orall of the entered text to server system 120, and can cause predictedwords to be displayed on display 116.

In some examples, user device 102 can include storage device 106, memory108, word stem n-gram language model 110, word suffix n-gram languagemodel 112, and stem category database 114. In some examples, languagemodels 110 and 112, and database 114 are stored on storage device 106,and can be used to predict words and determine probabilities accordingto the methods discussed herein. Language models 110 and 112 can betrained on any of a variety of text data, and can includedomain-specific models for use in particular applications, as will beappreciated by one of ordinary skill in the art.

The functions or methods discussed herein can be performed by a systemsimilar or identical to system 100. It should be appreciated that system100 can include instructions stored in a non-transitory computerreadable storage medium, such as memory 108 or storage device 106, andexecuted by processor 104. The instructions can also be stored and/ortransported within any non-transitory computer readable storage mediumfor use by or in connection with an instruction execution system,apparatus, or device, such as a computer-based system,processor-containing system, or other system that can fetch theinstructions from the instruction execution system, apparatus, or deviceand execute the instructions. In the context of this document, a“non-transitory computer readable storage medium” can be any medium thatcan contain or store the program for use by or in connection with theinstruction execution system, apparatus, or device. The non-transitorycomputer readable storage medium can include, but is not limited to, anelectronic, magnetic, optical, electromagnetic, infrared, orsemiconductor system, apparatus, or device, a portable computer diskette(magnetic), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM), a portable optical disc such as CD, CD-R, CD-RW, DVD,DVD-R, or DVD-RW, or flash memory such as compact flash cards, secureddigital cards, USB memory devices, memory sticks, and the like.

It should be understood that system 100 is not limited to the componentsand configuration of FIG. 1, but can include other or additionalcomponents in multiple configurations according to various examples. Forexample, user device 102 can include a variety of other mechanisms forreceiving input from a user, such as a microphone, optical sensor,camera, gesture recognition sensor, proximity sensor, ambient lightsensor, or the like. Additionally, the components of system 100 can beincluded within a single device, or can be distributed among multipledevices. For example, although FIG. 1 illustrates language models 110and 112, and stem category database 114, as part of user device 102, itshould be appreciated that, in other examples, the functions ofprocessor 104 can be performed by server system 120, and/or one or moreof entities 110, 112, and 114 can be stored remotely as part of serversystem 122 (e.g., in a remote storage device). In still other examples,language models and other data can be distributed across multiplestorage devices, and many other variations of system 100 are alsopossible.

FIG. 2 illustrates exemplary process 200 for predicting user input usinga categorical stem and suffix word n-gram language model. In someembodiments, process 200 is executed on processor 104 of system 100utilizing stem n-gram language model 110, suffix n-gram language model112, and stem and stem category database 114 (FIG. 1).

At block 202 of process 200, input is received from a user. The inputcan be received in any of a variety of ways, such as from keyboard 118in system 100 (FIG. 1) discussed above. The input also can be voiceinput received through a microphone or a touchscreen of system 100 (FIG.1). The input can include a single typed character, such as a letter orsymbol. The typed input can also include a string of characters, a word,multiple words, multiple sentences, or the like. The input received atblock 202 can be directed to various types of interface or environmenton an electronic device. For example, such an interface could beconfigured for typing text messages, emails, web addresses, documents,presentations, search queries, media selections, commands, form data,calendar entries, notes, or the like.

The input received at block 202 is used to predict a word. In someembodiments, the input is used to predict one or more of:

-   -   a subsequent word likely to be entered following        previously-entered words;    -   the likely completion of a partially-entered word; and/or    -   a group of words likely to be entered following        previously-entered words.

Previously-entered characters or words can be considered as observedcontext that can be used to make predictions. For reference, let:

W _(q−n+1) ^(q) =w _(q−n+1) w _(q−n+2) . . . q _(q−1) w _(q),  (1)

denote the string of n words relevant to the prediction of the currentword w_(q), and assume that w_(q) can be decomposed into a stem s_(q)and a suffix f_(q). The n words may be one or more words in the receivedinput.

At block 204, the probability of a current word w_(q) is determined,using a word n-gram language model, based on the available word history(e.g., W_(q−n+1) ^(q)). As one of ordinary skill would appreciate, somemorpheme-based word n-gram language models compute the probability of acurrent word w_(q) as follows:

Pr(w _(q) |W _(q−n+1) ^(q−1))=Pr(f _(q) |s _(q) W _(q−n+2) ^(q−1))·Pr(s_(q) |W _(q−n+1) ^(q−1)),  (2)

where W_(q−n+1) ^(q−1) refers to the relevant string of n−1 words usedfor stem prediction, and W_(q−n+2) ^(q−1) refers to the truncated-by-one(e.g., q−n+2 instead of q−n+1) history used for suffix prediction. Theoverall prediction of w_(q) is thus a joint prediction of a stem s_(q)and a suffix f_(q).

In contrast to the standard morpheme-based prediction model, in someembodiments, the n-gram language model has a stem LM (e.g., languagemodel 110 in FIG. 1) and a suffix LM (e.g., language model 112 inFIG. 1) decoupled from the stem LM. In these embodiments, while theprobability of the stem prediction remains the same asPr(w_(q)|W_(q−n+1) ^(q−1)), the suffix model becomes Pr(s_(q)|CW_(q−n+1)^(q−1)), where C denotes a generic stem category accounted for in thesuffix language model. The probability of the current word w_(q) thuscan be computed as:

Pr(w _(q) |W _(q−n+1) ^(q−1))=Pr(f _(q) |CW _(q−n+1) ^(q−1))·Pr(s _(q)|W _(q−n+1) ^(q−1))  (3)

Because a stem is always present before a suffix, the generic category Chas no impact on the word history that is available for suffixprediction. As such, the scope of conditioning is identical for both thestem and the suffix language models, e.g., both are based upon W_(q−n+1)^(q−1). Accordingly, suffix prediction in Equation (3) no longer relieson a truncated-by-one word history, thereby leading to more robust wordpredictions.

Despite its increased robustness, Equation (3) can still generatespurious linguistic events because stem and suffix consistency is notguaranteed, meaning it is possible for Equation (3) to predict “hespeaked fast” given the training observation “he speaks fast”.

To further enhance the n-gram language model, in some embodiments, then-gram language model constrains stem and suffix predictions byaccounting for stem categories and association of those stem categorieswith suffixes deemed grammatically valid for conjunction with stems ofparticular categories. For example, French has (among others) regularverbs ending in “_er” and “_ir”. An “_er” stem category and an “_ir”stem category can be defined. The categories can then be associated withthe set of inflectional morphemes called for by the particular stemcategory. For example, the stem category of “_er” may be associated witha list of suffixes that begin with letter “_e”.

In some embodiments, stem categorization is based on the type of verb,such as whether a verb is a regular or irregular verb. In someembodiments, some types of verbs are not predicted using stem and suffixconstraints. For example, irregular verbs can be predicted usingalternate language models while stem categorization is performed forregular verbs. In some embodiments, stem categorization is based on stemspelling. For example, stem categorization in French can be based onstem spelling, particularly the consecutive characters at end of thestem (e.g., “_ir”).

The defining of stem categories and the association of suffixes todefined stem categories are deterministic, and can be performed a priorito prediction-time. For example, in French an “_er” stem category may bedefined and be associated with suffixes beginning with “_e”. The contextin which a “_er” verb is used in French need not alter the underlyingconstraint. As the associated stem category for a particular word may beindependent of the context in which the word appears, the associationmay be created a priori in the underlying categorical stem and suffixn-gram language model.

For reference, let stem categories be defined as {C_(k) }, 1≦k≦K, whereK represents the total number of stem categories accounted for in thelanguage model. The probability of the current word w_(q) based onprevious user input, accounting for categorical stem and suffixconstraints, is computed as:

$\begin{matrix}\begin{matrix}{{\Pr \left( {w_{q}W_{q - n + 1}^{q - 1}} \right)} = {{\Pr \left( {f_{q}{s_{q}W_{q - n + 1}^{q - 1}}} \right)} \cdot {\Pr \left( {s_{q}W_{q - n + 1}^{q - 1}} \right)}}} \\{= {\left( {\sum\limits_{k = 1}^{K}{\Pr \left( {{f_{q}C_{k}}{s_{q}W_{q - n + 1}^{q - 1}}} \right)}} \right) \cdot {\Pr \left( {s_{q}W_{q - n + 1}^{q - 1}} \right)}}} \\{= {\left( {\sum\limits_{k = 1}^{K}{{\Pr \left( {f_{q}{C_{k}s_{q}W_{q - n + 1}^{q - 1}}} \right)} \cdot {\Pr \left( {C_{k}{s_{q}W_{q - n + 1}^{q - 1}}} \right)}}} \right) \cdot}} \\{{\Pr \left( {s_{q}W_{q - n + 1}^{q - 1}} \right)}} \\{= {\sum\limits_{k = 1}^{K}{{\Pr \left( {f_{q}{C_{k}W_{q - n + 1}^{q - 1}}} \right)} \cdot {\Pr \left( {C_{k}s_{q}} \right)} \cdot}}} \\{{{\Pr \left( {s_{q}W_{q - n + 1}^{q - 1}} \right)},}}\end{matrix} & (4)\end{matrix}$

The derivation of Equation (4)—particularly in the last step—takesadvantage of the fact that conditioning on the stem category inPr(f_(q)|C_(k)s_(q)W_(q−n+1) ^(q−1)) subsumes conditioning on the actualstem. Thus, no approximation is needed in the derivation of Equation(4). Notably, although equation (4) resembles Equation (3), closerinspection of Equation (4) reveals that the underlying language modelingconsiders multiple categories C_(k) to enforce stem and suffixconsistency in word predictions.

Referring again to block 204 of process 200 (FIG. 2), in embodimentsutilizing Equation (4) (or a similar probability function), theprobability of a current word w_(q) is determined by, among otherthings, determining the probability of stem s_(q) Pr(s_(q)|W_(q−n+1)^(q−1)) and the probability of suffix f_(q) in view of stem categoryC_(k) Pr(f_(q)|C_(k)W_(q−n+1) ^(q−1)), for {C_(k) }, 1≦k≦K, where Krepresents the total number of stem categories accounted for in thelanguage model.

At block 206, the probability of predicted suffix f_(q) as beinggrammatically valid for a predicted stem s_(q) is determined. In someembodiments this probability is determined based on Pr(C_(k)|s_(q)) asshown in Equation (4) or a similar probability function. Pr(C_(k)|s_(q))provides the probability of stem s_(q) as corresponding to a stemcategory C_(k). Notably, the expression Pr(C_(k)|s_(q)) produces a zerovalue if the predicted stem s_(q) is not associated with stem categoryC_(k). This effect of Pr(C_(k)|s_(q)) is further discussed with respectto block 208, below.

At block 208, an integrated (e.g., joint) probability of the predictionsfrom blocks 204 and 206 is determined. In some embodiments thisintegrated probability is based on the integrated probability producedfrom Equation (4) or a similar probability function. As Pr(C_(k)|s_(q))produces zero if a predicted stem s_(q) is not associated with stemcategory C_(k), the inclusion of Pr(C_(k)|s_(q)) in Equation (4)effectively zeroes out the probability for w_(q) having suffixf_(q)—even if Pr(f_(q)|C_(k)W_(q−n+1) ^(q−1)) provides a positiveprobability—where the predicted stem s_(q) is not associated with stemcategory C_(k). Further, the integrated probability may include asummation of probabilities for each k where 1≦k≦K, as a given predictedstem s_(q) (and suffix f_(q)) can be associated with more than one stemcategory C_(k). In this way, the joint probability constraints possibleword predictions w_(q) to those having non-zero Pr(C_(k)|s_(q)) for atleast one C_(k) where 1≦k≦K. For example, a word prediction w_(q)(comprising stem s_(q) and suffix f_(q)) is possible where both theprobability of a stem s_(q) being associated with stem category C_(k)and the probability of a suffix f_(q) in view of C_(k) are non-zero.

At block 210, an output of the predicted word is provided, based on theintegrated probability determined at block 208. In some embodiments, apredicted word has a non-zero probability as determined at block 208. Insome embodiments, block 210 outputs one or more predicted words havingthe highest prediction probabilities among one or more predicted words.In some embodiments, block 210 determines whether the integratedprobability for any predicted word w_(q) exceeds a predeterminedthreshold probability value. In these embodiments, block 210 may outputa predicted word w_(q) if its probability exceeds the threshold, andblock 210 may forego output of predicted word(s) if no predicted wordw_(q) exceeds the predetermined threshold. When this is the case,process 200 can return to block 202 to await further input from a user.Blocks 202, 204, 206, and 208 can be repeated with the addition of eachnew word entered by a user, and a determination can be made for each newword whether a predicted word should be displayed based on newlydetermined integrated probabilities of candidate words.

The outputting of the predicted word can include displaying the one ormore predicted words. In some embodiments, the outputting of a predictedword includes displaying a user-selectable affordance representing thepredicted word, such that the word can be selected by the user withoutthe user having to individually and completely enter all the charactersof the word. The outputting of the predicted word may include playbackof the one or more predicted words. In some embodiments, outputting apredicted word includes passing the predicted word to an inputrecognition sub-routine (e.g., a handwriting recognition or voicerecognition sub-routine) such that further user output can be providedby the downstream sub-routine. For example, a handwriting recognitionsub-routine can display an image of the predicted word that resembleshandwriting, based on the word prediction. For example, a voicerecognition sub-routine can provide a speech-to-text and/orspeech-to-speech output, based on the word prediction. The audio outputmay be determined with the assistance of a voice-based assistant, suchas Siri® by Apple Inc. of Cupertino, Calif.

The above-described approach to predicting words, particularly inflectedwords, combines the benefits of using decoupled stem and suffix languagemodels (e.g., improved size and accuracy) while reducing ungrammaticalword predictions based on categorical stem and suffix constraints (e.g.,avoiding spurious predictions such as “he speaked fast”). An electronicdevice employing these techniques for predicting words can permit userinput without requiring the user to individually and manually enter eachcharacter and/or word associated with an input string, while limitingthe occurrence of spurious predictions. In this way, the efficiency ofthe man-machine interaction and the user's overall user experience withthe electronic device are both improved drastically.

FIG. 3 shows a functional block diagram of exemplary electronic device300 configured in accordance with the principles of the variousdescribed examples. The functional blocks of the device can beimplemented by hardware, software, or a combination of hardware andsoftware to carry out the principles of the various described examples,including those described with reference to process 200 of FIG. 2. It isunderstood by persons of skill in the art that the functional blocksdescribed in FIG. 3 can be combined or separated into sub-blocks toimplement the principles of the various described examples. Therefore,the description herein optionally supports any possible combination orseparation or further definition of the functional blocks describedherein.

As shown in FIG. 3, exemplary electronic device 300 includes displayunit 302 configured to display a word entry interface, and an inputreceiving unit 304 configured to receive input such as touch inputand/or voice input from a user. Input receiving unit 304 can beintegrated with display unit 302 (e.g., as in a touchscreen) and displayunit 302 can display a virtual keyboard. Electronic device 300 furtherincludes a processing unit 306 coupled to display unit 302 and inputreceiving unit 304. Processing unit 306 includes a predicted worddetermining unit 308, a stem category unit 310, and an integratedprobability determining unit 312.

Processing unit 306 can be configured to receive input from a user(e.g., from input receiving unit 304). Predicted word determining unit308 can be configured to determine, using n-gram language models, theprobability of a predicted word (having a stem and suffix) based on oneor more previously entered words in the typed input. Stem category unit310 can be configured to aid predicted word determining unit 308 indetermining the probability of a predicted suffix being grammaticallyvalid with a predicted stem. Integrated probability determining unit 312can be configured to determine a joint probability of the predicted wordbased on the probability of the predicted stem, the probability of thepredicted suffix, and the probability of the predicted suffix beinggrammatically valid for the predicted stem. Processing unit 306 can befurther configured to cause the predicted word to be displayed (e.g.,using display unit 302) based on the integrated probability.

Processing unit 306 can be further configured to determine (e.g., usingpredicted word determining unit 308) the probability of the predictedword based on a plurality of words in the typed input. In some examples,the plurality of words comprises a string of recently entered words. Forexample, recently entered words can include words entered in a currentinput session (e.g., in a current text message, a current email, acurrent document, etc.). For predicting words, the recently enteredwords can include the last n words entered (e.g., the last three words,the last four words, the last five words, or any other number of words).

Although examples have been fully described with reference to theaccompanying drawings, it is to be noted that various changes andmodifications will become apparent to those skilled in the art (e.g.,modifying any of the systems or processes discussed herein according tothe concepts described in relation to any other system or processdiscussed herein). Such changes and modifications are to be understoodas being included within the scope of the various examples as defined bythe appended claims.

What is claimed is:
 1. A method for predicting words, the methodcomprising: at an electronic device: receiving input from a user;determining, using an n-gram language model, a probability of apredicted word based on a previously-input word in the received input,wherein the predicted word comprises a stem and a suffix; determining, aprobability of the suffix being grammatically valid for the stem;determining an integrated probability of the predicted word based on theprobability of the predicted word and the probability of the suffixbeing grammatically valid for the stem; and providing output of thepredicted word, based on the integrated probability.
 2. The method ofclaim 1, wherein the stem is associated with a stem category, andwherein determining the probability of the predicted word comprisesdetermining a probability of the suffix based on the stem category andthe previously-input word.
 3. The method of claim 2, wherein the stem isassociated with a stem category, and wherein determining the probabilityof the suffix being grammatically valid for the stem comprisesdetermining a probability of the stem being associated with the stemcategory.
 4. The method of claim 1, wherein determining the probabilityof the predicted word using the n-gram language model comprises:determining, using a first n-gram language model, a probability of thestem based on the previously-input word in the received input; anddetermining, using a second n-gram language model, a probability of thesuffix based on the previously-input word in the received input, whereinthe first and the second n-gram language models are different languagemodels.
 5. The method of claim 4, wherein the first and the secondn-gram language models are decoupled.
 6. The method of claim 4, whereinthe first n-gram language model is a word stem n-gram language model andthe second n-gram language model is a word suffix n-gram language model.7. The method of claim 3, wherein determining the probability of thestem being associated with the stem category is based on a spelling ofthe stem.
 8. The method of claim 3, wherein determining the probabilityof the stem being associated with the stem category is based on aplurality of consecutive characters at the end of the stem.
 9. Themethod of claim 1, wherein determining the probability of the suffixbeing grammatically valid for the stem comprises: assigning aprobability of zero to the determination if the stem does not belong toa stem category.
 10. The method of claim 1, further comprising:determining whether the stem is a regular verb, and in accordance adetermination that the stem is not a regular verb, forgoing output ofthe predicted word based on the integrated probability.
 11. The methodof claim 1, wherein determining the probability of the predicted wordcomprises determining, using the word n-gram model, the probability ofthe predicted word based on a plurality of words in the input.
 12. Themethod of claim 11, wherein the plurality of words comprises a string ofrecently entered words.
 13. The method of claim 1, wherein the receivedinput is typed input.
 14. The method of claim 1, wherein the receivedinput is verbal input.
 15. The method of claim 1, wherein providingoutput of the predicted word comprises displaying the predicted word.16. The method of claim 1, wherein providing output of the predictedword comprises audible playback of the predicted word.
 17. Anon-transitory computer-readable storage medium comprisingcomputer-readable instructions, which when executed by one or moreprocessors, cause the one or more processors to: receive input from auser; determine, using an n-gram language model, a probability of apredicted word based on a previously-input word in the received input,wherein the predicted word comprises a stem and a suffix; determine, aprobability of the suffix being grammatically valid for the stem;determine an integrated probability of the predicted word based on theprobability of the predicted word and the probability of the suffixbeing grammatically valid for the stem; and provide output of thepredicted word, based on the integrated probability.
 18. A systemcomprising: one or more processors; memory storing one or more programs,wherein the one or more programs include instructions, which whenexecuted by the one or more processors, cause the one or more processorsto: receive input from a user; determine, using an n-gram languagemodel, a probability of a predicted word based on a previously-inputword in the received input, wherein the predicted word comprises a stemand a suffix; determine, a probability of the suffix being grammaticallyvalid for the stem; determine an integrated probability of the predictedword based on the probability of the predicted word and the probabilityof the suffix being grammatically valid for the stem; and provide outputof the predicted word, based on the integrated probability.
 19. Thesystem of claim 18, wherein the stem is associated with a stem category,and wherein determining the probability of the predicted word comprisesdetermining a probability of the suffix based on the stem category andthe previously-input word.
 20. The system of claim 19, wherein: the stemis associated with a stem category, and determining the probability ofthe suffix being grammatically valid for the stem comprises determininga probability of the stem being associated with the stem category. 21.The system of claim 19, wherein determining the probability of thepredicted word using the n-gram language model comprises: determining,using a first n-gram language model, a probability of the stem based onthe previously-input word in the received input; and determining, usinga second n-gram language model, a probability of the suffix based on thepreviously-input word in the received input, wherein the first and thesecond n-gram language models are different language models.
 22. Thesystem of claim 21, wherein the first n-gram language model is a wordstem n-gram language model and the second n-gram language model is aword suffix n-gram language model.
 23. The system of claim 18, whereindetermining the probability of the suffix being grammatically valid forthe stem comprises: assigning a probability of zero to the determinationif the stem does not belong to a stem category.
 24. The system of claim18, wherein determining the probability of the predicted word comprisesdetermining, using the word n-gram model, the probability of thepredicted word based on a plurality of words in the input.
 25. Thesystem of claim 24, wherein the plurality of words comprises a string ofrecently entered words.